﻿using System;

namespace DVD_Explorer
{
	public class HRESULT
	{
		public static bool SUCCEEDED(HRESULT hr)
		{
			return (hr >= 0);
		}

		public static bool FAILED(HRESULT hr)
		{
			return (hr < 0);
		}

		public static implicit operator int(HRESULT hr)
		{
			return hr.m_hr;
		}

        public static explicit operator HRESULT(int hr)
		{
			HRESULT h = new HRESULT();
			h.m_hr = hr;
			return h;
		}

		private int m_hr;
	}
}